<template>
  <div class="main-container-app">
    <el-row class="form-contain">
      <equipment-mag-form @handleQueryParkingMag="handleQueryParkingMag"></equipment-mag-form>
    </el-row>
    <div class="table-contain">
    <equipment-mag-table :searchList="parkingMagRes" :listLoadingParkingMag="loading"
                       @handleCurrentChangeParkingMag="handleCurrentChangeParkingMag"
                       @handleSizeChangeParkingMag="handleSizeChangeParkingMag"></equipment-mag-table>
    </div>
  </div>
</template>

<script>
  /* eslint-disable */
  import EquipmentMagForm from "./equipmentMagChild/equipmentMagForm";
  import EquipmentMagTable from "./equipmentMagChild/equipmentMagTable";
  import {fetchListParkMag} from "../../api/parkingResource/parkingMag";
  import {selDictonaryValue} from "../../api/dictionary";

  export default {
    components: {
      EquipmentMagTable,
      EquipmentMagForm
    },
    data() {
      return {
        parkingMagRes: null,
        loading: false,
        queryData:{
          park_date: '',
          park_eroad: '',
          park_jdbsc: '',
          park_name: '',
          park_no: '',
          park_road: '',
          park_roadkind: '',
          park_sroad: '',
          park_ssdw: '',
          park_status: '',
          park_sfbz: ''
        },
        listQuery: {
          page: 1,
          limit: 20
        }
      }
    },
    methods: {
      handleQueryParkingMag(val) {
        this.queryData = val
        this.listQuery.page=1
        this.listQuery.limit=20
        this.getDataListParkingMag()
      },
      handleSizeChangeParkingMag(val) {
        this.listQuery.limit = val
        this.listQuery.page = 1
        this.getDataListDouPay()
      },
      handleCurrentChangeParkingMag(val) {
        this.listQuery.page = val;

        this.getDataListParkingMag()
      },
      getDataListParkingMag() {
        this.loading = true;
        this.parkingMagRes={limit:{},list:[]};
        this.parkingMagRes.limit.total = 5;
        /*        equipment_no: '',
                  equipment_site: '',
                  equipment_desc: '',
                  equipment_status: '',
                  equipment_type: '',
                  equipment_person: '',
                  equipment_model: '',
                  equipment_manager: '',
                  equipment_operator: '',*/
        this.parkingMagRes.list= [
          {equipment_no:'371210001',equipment_site:'洪家楼南路',equipment_type:'诱导', equipment_buy_time:'2018-12-12 12:12:26', equipment_status:'正常',equipment_model: 'P16双色显示屏', equipment_manager: '章丘大队', equipment_operator: '鑫青松', equipment_long: '36.12', equipment_lati: '137.12', equipment_desc: '无'},
          {equipment_no:'371210002',equipment_site:'二环东路',equipment_type:'诱导',equipment_buy_time:'2018-12-12 12:12:26', equipment_status:'正常', equipment_model: 'P32双色显示屏',equipment_manager: '章丘大队', equipment_operator: '鑫青松', equipment_long: '36.323', equipment_lati: '136.12', equipment_desc: '无'},
          {equipment_no:'371210003',equipment_site:'二环西路',equipment_type:'其它',equipment_buy_time:'2018-12-12 12:12:26', equipment_status:'正常', equipment_model: '未知',equipment_manager: '章丘大队', equipment_operator: '鑫青松', equipment_long: '36.32', equipment_lati: '137.3', equipment_desc: '无'},
          {equipment_no:'371210004',equipment_site:'工业南路',equipment_type:'诱导',equipment_buy_time:'2018-12-12 12:12:26', equipment_status:'空闲',equipment_model: 'P16双色显示屏', equipment_manager: '章丘大队', equipment_operator: '鑫青松', equipment_long: '33.12', equipment_lati: '137.132', equipment_desc: '无'},
          {equipment_no:'371210005',equipment_site:'经十路', equipment_type:'诱导',equipment_buy_time:'2018-12-12 12:12:26', equipment_status:'故障',  equipment_model: 'P32双色显示屏',equipment_manager: '章丘大队', equipment_operator: '鑫青松', equipment_long: '36.42', equipment_lati: '137.21', equipment_desc: '无'}
        ];
        this.loading = false;
        /*fetchListParkMag(this.listQuery,this.queryData).then(res=>{
          selDictonaryValue(res).then(response=>{
            this.parkingMagRes=response
            console.log(response)
            this.loading = false
          })

        })*/
      }
    }

  }
</script>

<style scoped>
  .parkingMag {
    padding: 32px;
    background-color: rgb(240, 242, 245);
  }
</style>
